】<template>
	<view class="coupon">
		<view class="geader">
			<view class="item">
				<view class="header">
					<!-- 满减 -->
					<view class="left">
						<view class="minus">
							<view class="unit">
								￥
							</view>
							<view class="number">
								{{query.face}}
							</view>
						</view>
						<view class="full">
							{{query.threshold}}
						</view>
					</view>
					<!-- 虚线 -->
					<view class="height-dotted-line">
					</view>
					<!-- 名称 -->
					<view class="right">
						<view class="name-of-shop">
							<view class="title">
								{{query.name}}
							</view>
							<view class="time">
								使用期限：{{query.in_date}}
							</view>
						</view>
					</view>
				</view>
				<!-- 虚线 -->
				<view class="width-dotted-line">
				</view>
				<view class="Folding-panel">
					<view class="row-box" @click="toggle">
						<view class="official">
							{{query.top_ast}}
						</view>
						<u-icon :name="query.open?'arrow-up':'arrow-down'" size="14" color="#dbdbdb"></u-icon>
					</view>
					<view class="remark" v-if="query.open">
						<view v-for="(childitem,childindex) in query.ast_list" :key="childindex" style="margin-bottom: 5rpx;">
							{{childitem}}
						</view>
					</view>
				</view>
			</view>

		</view>
<!-- 		<view :class="status?'btn2':'btn1'">
			{{status?'领取成功，去使用':'立即领取'}}
		</view> -->
	</view>
</template>

<script>
	export default {
		props: {
			query: {
				type: null,
				default: null,
				required: true
			}
		},
		data() {
			return {
			}
		},
		methods: {
			toggle(message) {
				console.log('message', message);
				this.$emit('toggle')
			},
		}
	}
</script>

<style lang="scss" scoped>
	.coupon {
		display: flex;
		flex-direction: column;
		align-items: center;

		.geader {
			margin: 24rpx 0 0;
			height: 350rpx;

			.item {
				width: 702rpx;
				background: #f6f6f6;
				border-radius: 16rpx;
				display: flex;
				flex-direction: column;
				margin-bottom: 20rpx;
				z-index: 22;

				.header {
					width: 100%;
					height: 158rpx;
					display: flex;
					flex-direction: row;
					align-items: center;

					.left {
						width: 185rpx;
						display: flex;
						flex-direction: column;
						align-items: center;
						padding-left: 32rpx;

						.minus {
							display: flex;
							flex-direction: row;
							align-items: baseline;
							margin-bottom: 2rpx;

							.unit {
								font-size: 24rpx;
								font-family: PingFang SC, PingFang SC-Bold;
								font-weight: 700;
								text-align: left;
								color: #f37364;
							}

							.number {
								font-size: 56rpx;
								font-family: DIN, DIN-Bold;
								font-weight: 700;
								text-align: left;
								color: #f37364;
							}
						}

						.full {
							font-size: 24rpx;
							font-family: PingFang SC, PingFang SC-Medium;
							font-weight: 500;
							text-align: center;
							color: #666666;
						}
					}

					.height-dotted-line {
						width: 0rpx;
						height: 118rpx;
						opacity: 0.1;
						border: 1rpx dashed #333333;
						margin-right: 33rpx;
					}

					.right {
						flex: 1;
						padding-right: 32rpx;
						display: flex;
						flex-direction: row;
						align-items: center;

						.name-of-shop {
							display: flex;
							flex-direction: column;
							width: 336rpx;

							.title {
								font-size: 32rpx;
								font-family: PingFang SC, PingFang SC-Bold;
								font-weight: 700;
								text-align: left;
								color: #333333;
								margin-bottom: 8rpx;
							}

							.time {
								flex: 1;
								font-size: 20rpx;
								font-family: PingFang SC, PingFang SC-Regular;
								font-weight: 400;
								text-align: left;
								color: #666666;
							}
						}

						.img {
							width: 116rpx;
							height: 116rpx;
						}
					}
				}

				// 虚线
				.width-dotted-line {
					opacity: 0.1;
					border: 1rpx dashed #333333;
				}

				// 折叠面板
				.Folding-panel {
					display: flex;
					flex-direction: column;
					width: 100%;
					padding: 18rpx 32rpx 16rpx;

					.row-box {
						width: 100%;
						display: flex;
						flex-direction: row;
						align-items: center;
						padding-bottom: 12rpx;

						.official {
							font-size: 24rpx;
							font-family: PingFang SC, PingFang SC-Regular;
							font-weight: 400;
							text-align: left;
							color: #666666;
							flex: 1;
						}
					}

					.remark {
						width: 578rpx;
						font-size: 24rpx;
						font-family: PingFang SC, PingFang SC-Regular;
						font-weight: 400;
						text-align: left;
						color: #666666;
						line-height: 28rpx;
						display: flex;
						flex-direction: column;
					}
				}
			}
		}

		.btn1 {
			width: 702rpx;
			height: 88rpx;
			background: #73F0EA;
			border-radius: 16rpx;
			font-size: 34rpx;
			font-family: PingFang SC, PingFang SC-Bold;
			font-weight: 700;
			text-align: center;
			color: #ffffff;
			display: flex;
			align-items: center;
			justify-content: center;
		}

		.btn2 {
			width: 702rpx;
			height: 88rpx;
			border: 1rpx solid #73F0EA;
			border-radius: 16rpx;
			font-size: 34rpx;
			font-family: PingFang SC, PingFang SC-Bold;
			font-weight: 700;
			text-align: center;
			color: #73F0EA;
			display: flex;
			align-items: center;
			justify-content: center;
		}
	}
</style>